import os
import sys

current_path = os.path.dirname(os.path.abspath(__file__))
root_path = os.path.dirname(current_path)
log_path = os.path.join(root_path, 'log')
conf_path = os.path.join(root_path, 'conf')

# 判断是否是打包环境
if getattr(sys, 'frozen', False):
    db_path = os.path.join(os.path.dirname(sys.executable), "modbus-client.db")
else:
    db_path = os.path.join(root_path, "modbus-client.db")

if __name__ == '__main__':
    print(current_path)
    print(root_path)
    print(log_path)
    print(conf_path)
